Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 7.63.x] [CWS] pass the missing logs compression component to the direct sender #33466

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

agent-platform-auto-pr[bot]
Copy link
Contributor

Backport 7c637fe from #33462.


<!--

  • Contributors are encouraged to read our CONTRIBUTING documentation.
  • Both Contributor and Reviewer Checklists are available at https://datadoghq.dev/datadog-agent/guidelines/contributing/#pull-requests.
  • The pull request:
    • Should only fix one issue or add one feature at a time.
    • Must update the test suite for the relevant functionality.
    • Should pass all status checks before being reviewed or merged.
  • Commit titles should be prefixed with general area of pull request's change.
  • Please fill the below sections if possible with relevant information or links.
    -->

What does this PR do?

In direct sender mode, we found the following stack trace

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x260f1d4]
goroutine 1 [running]:
[github.com/DataDog/datadog-agent/pkg/logs/pipeline.getStrategy(0xc000b42690](http://github.com/DataDog/datadog-agent/pkg/logs/pipeline.getStrategy(0xc000b42690), 0xc000b42700, 0xc001315dc0, 0xc0040d5e60, 0x0, 0x0, {0x6805ad8, 0xc0042836e0}, {0x0, 0x0})
	/home/spi/dd/datadog-agent2/pkg/logs/pipeline/pipeline.go:175 +0x74
[github.com/DataDog/datadog-agent/pkg/logs/pipeline.NewPipeline(0xc001315ab0](http://github.com/DataDog/datadog-agent/pkg/logs/pipeline.NewPipeline(0xc001315ab0), {0x0, 0x0, 0x0}, 0xc0040d5e60, 0xc0040f8460, {0x67e04c0, 0x8af4b00}, 0x0, 0x0, ...)
	/home/spi/dd/datadog-agent2/pkg/logs/pipeline/pipeline.go:84 +0x2d2
[github.com/DataDog/datadog-agent/pkg/logs/pipeline.(*provider).Start(0xc003ff26c0)](http://github.com/DataDog/datadog-agent/pkg/logs/pipeline.(*provider).Start(0xc003ff26c0))
	/home/spi/dd/datadog-agent2/pkg/logs/pipeline/provider.go:135 +0x168
[github.com/DataDog/datadog-agent/pkg/security/reporter.newReporter({0x0](http://github.com/DataDog/datadog-agent/pkg/security/reporter.newReporter(%7B0x0), 0x0}, {0x67ee678, 0xc000c24618}, {0x3345ba2, 0x16}, {0x332a679, 0x10}, 0xc0040d5e60, 0xc0040f8460, ...)
	/home/spi/dd/datadog-agent2/pkg/security/reporter/reporter.go:57 +0x2e5
[github.com/DataDog/datadog-agent/pkg/security/reporter.NewCWSReporter(...)](http://github.com/DataDog/datadog-agent/pkg/security/reporter.NewCWSReporter(...))
	/home/spi/dd/datadog-agent2/pkg/security/reporter/reporter.go:46
[github.com/DataDog/datadog-agent/pkg/security/module.NewDirectMsgSender({0x67ee678](http://github.com/DataDog/datadog-agent/pkg/security/module.NewDirectMsgSender(%7B0x67ee678), 0xc000c24618}, {0x0, 0x0})
	/home/spi/dd/datadog-agent2/pkg/security/module/msg_sender.go:90 +0x1e7
[github.com/DataDog/datadog-agent/pkg/security/module.NewAPIServer(0xc00037a008](http://github.com/DataDog/datadog-agent/pkg/security/module.NewAPIServer(0xc00037a008), 0xc000861908, {0x0, 0x0}, {0x682a8b0, 0xc000246380}, 0xc0029a6630, {0x0, 0x0})
	/home/spi/dd/datadog-agent2/pkg/security/module/server.go:597 +0x2a7
[github.com/DataDog/datadog-agent/pkg/security/module.NewCWSConsumer(0xc00075f050](http://github.com/DataDog/datadog-agent/pkg/security/module.NewCWSConsumer(0xc00075f050), 0xc00037a008, {0x6834280, 0xc0002fbc30}, {{0x0?, 0x0?}, {0x0?, 0x0?}}, {0x0, 0x0})
	/home/spi/dd/datadog-agent2/pkg/security/module/cws.go:88 +0x2dc
[github.com/DataDog/datadog-agent/cmd/system-probe/modules.createEventMonitorModule(0x434bcb](http://github.com/DataDog/datadog-agent/cmd/system-probe/modules.createEventMonitorModule(0x434bcb)?, {{{}}, {0x6834280, 0xc0002fbc30}, {0x682c778, 0xc00051e540}, {0x6828540, 0xc000c25a70}, {0x0, 0x0}})
	/home/spi/dd/datadog-agent2/cmd/system-probe/modules/eventmonitor.go:56 +0x2ab
[github.com/DataDog/datadog-agent/cmd/system-probe/api/module.Register.func1()](http://github.com/DataDog/datadog-agent/cmd/system-probe/api/module.Register.func1())
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/module/loader.go:90 +0xab
[github.com/DataDog/datadog-agent/cmd/system-probe/api/module.withModule.func1({0x6802a58](http://github.com/DataDog/datadog-agent/cmd/system-probe/api/module.withModule.func1(%7B0x6802a58)?, 0xc0009cf2f0?})
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/module/loader.go:59 +0x13
runtime/pprof.Do({0x68027f0?, 0x8af4b00?}, {{0xc0010e28a0?, 0x8584300?, 0x32faa28?}}, 0xc0014068e0)
	/home/spi/go/pkg/mod/golang.org/[email protected]/src/runtime/pprof/runtime.go:51 +0x8c
[github.com/DataDog/datadog-agent/cmd/system-probe/api/module.withModule({0x331bf73](http://github.com/DataDog/datadog-agent/cmd/system-probe/api/module.withModule(%7B0x331bf73)?, 0xc000bf8f40?}, 0xc001406a88)
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/module/loader.go:58 +0x1a8
[github.com/DataDog/datadog-agent/cmd/system-probe/api/module.Register(0xc0005b1480](http://github.com/DataDog/datadog-agent/cmd/system-probe/api/module.Register(0xc0005b1480), 0xc00085cb40, {0x8298980?, 0xc000bf22c8?, 0x27b9592?}, {0x6834280, 0xc0002fbc30}, {0x682c778, 0xc00051e540}, {0x6828540, ...})
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/module/loader.go:84 +0x512
[github.com/DataDog/datadog-agent/cmd/system-probe/api.StartServer(0xc0005b1480](http://github.com/DataDog/datadog-agent/cmd/system-probe/api.StartServer(0xc0005b1480), {0x6828540, 0xc000c25a70}, {0x6834280, 0xc0002fbc30}, {0x682c778, 0xc00051e540}, {0x6816fb8, 0xc0007f5f40})
	/home/spi/dd/datadog-agent2/cmd/system-probe/api/server.go:41 +0x16f
[github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.startSystemProbe({0x6821580](http://github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.startSystemProbe(%7B0x6821580), 0xc0001334d8}, {0x6802e10, 0xc000c25a28}, {0x6828540, 0xc000c25a70}, {0x683f6c0, 0xc000a42000}, {0x67eb930, 0xc0008374d0}, ...)
	/home/spi/dd/datadog-agent2/cmd/system-probe/subcommands/run/command.go:383 +0x6a5
[github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.run({0x6821580](http://github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.run(%7B0x6821580), 0xc0001334d8}, {0xc000cae780?, 0xc001406f28?}, {0x6802e10, 0xc000c25a28}, {0x6828540, 0xc000c25a70}, {0x683f6c0, 0xc000a42000}, ...)
	/home/spi/dd/datadog-agent2/cmd/system-probe/subcommands/run/command.go:197 +0x2d5
reflect.Value.call({0x2f865a0?, 0x647e3c0?, 0xc0014074d0?}, {0x32f8b29, 0x4}, {0xc0010a5d40, 0xc, 0x67d7240?})
	/home/spi/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:581 +0xca6
reflect.Value.Call({0x2f865a0?, 0x647e3c0?, 0x8af4b00?}, {0xc0010a5d40?, 0x0?, 0x8c1b60?})
	/home/spi/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:365 +0xb9
[github.com/DataDog/datadog-agent/pkg/util/fxutil.(*delayedFxInvocation).call(0xc000000180?)](http://github.com/DataDog/datadog-agent/pkg/util/fxutil.(*delayedFxInvocation).call(0xc000000180?))
	/home/spi/dd/datadog-agent2/pkg/util/fxutil/args.go:72 +0x8e
[github.com/DataDog/datadog-agent/pkg/util/fxutil.OneShot({0x2f865a0](http://github.com/DataDog/datadog-agent/pkg/util/fxutil.OneShot(%7B0x2f865a0)?, 0x647e3c0?}, {0xc0004934a0, 0x15, 0x15})
	/home/spi/dd/datadog-agent2/pkg/util/fxutil/oneshot.go:54 +0x305
[github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.Commands.func1(0xc0006b2400](http://github.com/DataDog/datadog-agent/cmd/system-probe/subcommands/run.Commands.func1(0xc0006b2400)?, {0x32f89b1?, 0x4?, 0x32f8a9d?})
	/home/spi/dd/datadog-agent2/cmd/system-probe/subcommands/run/command.go:94 +0x1018
[github.com/spf13/cobra.(*Command).execute(0xc000313508](http://github.com/spf13/cobra.(*Command).execute(0xc000313508), {0x8af4b00, 0x0, 0x0})
	/home/spi/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
[github.com/spf13/cobra.(*Command).ExecuteC(0xc000313208)](http://github.com/spf13/cobra.(*Command).ExecuteC(0xc000313208))
	/home/spi/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
[github.com/spf13/cobra.(*Command).Execute(...)](http://github.com/spf13/cobra.(*Command).Execute(...))
	/home/spi/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
[github.com/DataDog/datadog-agent/cmd/internal/runcmd.Run(0xc000313208)](http://github.com/DataDog/datadog-agent/cmd/internal/runcmd.Run(0xc000313208))
	/home/spi/dd/datadog-agent2/cmd/internal/runcmd/runcmd.go:26 +0x25
main.main()
	/home/spi/dd/datadog-agent2/cmd/system-probe/main.go:22 +0x85

caused by a nil compressor component. This was caused by #27148 that added the need for this component when talking with logs, but the compressor component was not passed down to the CWS consumer.

This PR fixes this.

Motivation

Describe how you validated your changes

<!--
Validate your changes before merge, ensuring that:

  • Your PR is tested by static / unit / integrations / e2e tests
  • Your PR description details which e2e tests cover your changes, if any
  • The PR description contains details of how you validated your changes. If you validated changes manually and not through automated tests, add context on why automated tests did not fit your changes validation.

If you want additional validation by a second person, you can ask reviewers to do it. Describe how to set up an environment for manual tests in the PR description. Manual validation is expected to happen on every commit before merge.

Any manual validation step should then map to an automated test. Manual validation should not substitute automation, minus exceptions not supported by test tooling yet.
-->

Possible Drawbacks / Trade-offs

Additional Notes

<!--

  • Anything else we should know when reviewing?
  • Include benchmarking information here whenever possible.
  • Include info about alternatives that were considered and why the proposed
    version was chosen.
    -->

@agent-platform-auto-pr agent-platform-auto-pr bot added changelog/no-changelog component/system-probe team/ebpf-platform qa/done QA done before merge and regressions are covered by tests backport bot medium review PR review might take time labels Jan 28, 2025
@agent-platform-auto-pr agent-platform-auto-pr bot requested review from a team as code owners January 28, 2025 11:58
Copy link

Go Package Import Differences

Baseline: 01fe91d
Comparison: bad9381

binaryosarchchange
system-probelinuxamd64
+7, -0
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/impl
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-gzip
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-noop
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zlib
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zstd
+github.com/DataDog/datadog-agent/pkg/util/compression/selector
system-probelinuxarm64
+7, -0
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/impl
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-gzip
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-noop
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zlib
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zstd
+github.com/DataDog/datadog-agent/pkg/util/compression/selector
system-probewindowsamd64
+7, -0
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/fx
+github.com/DataDog/datadog-agent/comp/serializer/logscompression/impl
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-gzip
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-noop
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zlib
+github.com/DataDog/datadog-agent/pkg/util/compression/impl-zstd
+github.com/DataDog/datadog-agent/pkg/util/compression/selector

@agent-platform-auto-pr
Copy link
Contributor Author

Uncompressed package size comparison

Comparison with ancestor 1ac94d9c035cf3fddaa727935d2d6e2a6a847fcd

Diff per package
package diff status size ancestor threshold
datadog-agent-x86_64-rpm 3.72MB 943.03MB 939.31MB 0.50MB
datadog-agent-x86_64-suse 3.72MB 943.03MB 939.31MB 0.50MB
datadog-agent-amd64-deb 3.72MB 933.29MB 929.57MB 0.50MB
datadog-heroku-agent-amd64-deb 3.65MB 481.54MB 477.89MB 0.50MB
datadog-agent-aarch64-rpm 3.00MB 929.50MB 926.50MB 0.50MB
datadog-agent-arm64-deb 3.00MB 919.77MB 916.78MB 0.50MB
datadog-dogstatsd-amd64-deb 0.02MB ⚠️ 58.89MB 58.88MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.02MB ⚠️ 58.97MB 58.95MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.02MB ⚠️ 58.97MB 58.95MB 0.50MB
datadog-dogstatsd-arm64-deb 0.01MB ⚠️ 56.40MB 56.39MB 0.50MB
datadog-iot-agent-amd64-deb 0.01MB ⚠️ 93.97MB 93.97MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.00MB 94.04MB 94.04MB 0.50MB
datadog-iot-agent-x86_64-suse 0.00MB 94.04MB 94.04MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.00MB 90.09MB 90.09MB 0.50MB
datadog-iot-agent-arm64-deb 0.00MB 90.02MB 90.02MB 0.50MB

Decision

❌ Failed

Currently this PR is blocked, you can reach out to #agent-delivery-help to get support/ask for an exception.

@agent-platform-auto-pr
Copy link
Contributor Author

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv aws.create-vm --pipeline-id=54176252 --os-family=ubuntu

Note: This applies to commit bad9381

@AliDatadog AliDatadog merged commit 81ee80e into 7.63.x Jan 28, 2025
272 of 348 checks passed
@AliDatadog AliDatadog deleted the backport-33462-to-7.63.x branch January 28, 2025 12:35
@github-actions github-actions bot added this to the 7.64.0 milestone Jan 28, 2025
Copy link

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: bd32a479-1a09-4ec4-abc7-1b723f42e346

Baseline: 01fe91d
Comparison: bad9381
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_logs % cpu utilization +0.68 [-2.40, +3.76] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput +0.34 [-0.13, +0.81] 1 Logs
quality_gate_idle_all_features memory utilization +0.33 [+0.29, +0.38] 1 Logs bounds checks dashboard
file_to_blackhole_1000ms_latency egress throughput +0.33 [-0.44, +1.11] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.14 [-0.77, +1.05] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput +0.11 [-0.77, +0.98] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.09 [-0.78, +0.96] 1 Logs
quality_gate_idle memory utilization +0.07 [+0.04, +0.10] 1 Logs bounds checks dashboard
file_tree memory utilization +0.07 [+0.01, +0.12] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.05 [-0.86, +0.95] 1 Logs
file_to_blackhole_300ms_latency egress throughput +0.02 [-0.62, +0.66] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.02, +0.03] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.00 [-0.29, +0.29] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.02 [-0.75, +0.72] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.12 [-0.91, +0.66] 1 Logs
tcp_syslog_to_blackhole ingress throughput -0.41 [-0.48, -0.34] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10
quality_gate_logs lost_bytes 10/10
quality_gate_logs memory_usage 10/10

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport bot changelog/no-changelog component/system-probe medium review PR review might take time qa/done QA done before merge and regressions are covered by tests team/ebpf-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants